import request from '@/utils/request'

export function getTreeApi(data) {
  return request({
    url: '/api/ucenter.department/tree',
    method: 'post',
    data
  })
}

// 获取部门树
export function getDepartmentTreeApi(data) {
  return request({
    url: '/api/ucenter.department/getTree',
    method: 'post',
    data
  })
}

export function getAllDepartmentApi(data) {
  return request({
    url: "/api/ucenter.department/getAllDepartment",
    method: "post",
    data,
  });
}

// 添加部门
export function addDepartmentApi(data) {
  return request({
    url: '/api/ucenter.department/create',
    method: 'post',
    data
  })
}

// 编辑部门
export function saveDepartmentApi(data) {
  return request({
    url: '/api/ucenter.department/save',
    method: 'post',
    data
  })
}

// 删除部门
export function deleteDepartmentApi(data) {
  return request({
    url: '/api/ucenter.department/delete',
    method: 'post',
    data
  })
}